﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace AACalc.ViewModels
{
    public class Attendee : INotifyPropertyChanged
    {
        private string name;
        private double needPay;
        private double alreadyPay;

        public string Name
        {
            get
            {
                return this.name;
            }

            set
            {
                if (value != this.name)
                {
                    this.name = value;
                    NotifyPropertyChanged("Name");
                }
            }
        }

        public double NeedPay
        {
            get
            {
                return this.needPay;
            }

            set
            {
                if (!this.needPay.Equals(value))
                {
                    this.needPay = value;
                    NotifyPropertyChanged("NeedPay");
                }
            }
        }

        public double AlreadyPay
        {
            get
            {
                return this.alreadyPay;
            }

            set
            {
                if (!this.alreadyPay.Equals(value))
                {
                    this.alreadyPay = value;
                    NotifyPropertyChanged("AlreadyPay");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(String propertyName)
        {
            var handler = PropertyChanged;

            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }


}
